<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="../../WEB-INF/templates/UserTemplate.xhtml">
	<ui:define name="content">

		<h:form id="form">
			<p:panel id="panel" header="Liste des projets sur lesquels je travaille">
				<p:dataTable var="proj" value="#{login.projects}">
					<p:column>  
			            <p:rowToggler />
			        </p:column>
			        
					<p:column headerText="Nom du projet">
						<h:outputText value="#{proj.proName}" />
					</p:column>
					
					<p:column headerText="Description du projet">
						<h:outputText value="#{proj.proDescription}" />
					</p:column>
					
					<p:column headerText="Budget du projet">
						<h:outputText value="#{proj.proBudget} euros" />
					</p:column>
					
					<p:column headerText="Chef de projet">
						<h:outputText value="#{proj.employee.empLastname} #{proj.employee.empFirstname}" />
					</p:column>
					
					<p:rowExpansion>
						<p:dataTable var="act" value="#{userTableBean.getProjectActivities(login.employee, proj.proId)}">
							<f:facet name="header">  
			                    <h:outputText value="Liste des activités" />  
			                </f:facet>
			                
							<p:column headerText="Description de l'activité">
								<h:outputText value="#{act.actDescription}" />
							</p:column>
							
							<p:column headerText="Charge estimée">
								<h:outputText value="#{act.actCharge}" />
							</p:column>
							
							<p:column headerText="Heures imputées">
								<h:inputText value="#{act.actImput}" />
							</p:column>
							<p:column>
								<p:commandButton value="Modifier imputation" action="#{activityBean.update(act)}" />
							</p:column>
						</p:dataTable>
			        </p:rowExpansion>
				</p:dataTable>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>


